Platform Explorer / Nuxeo Platform 2023.9

Component org.nuxeo.drive.service.FileSystemItemAdapterService

Documentation

This service allows to get a FileSystemItem from a DocumentModel.

FileSystemItem is an adapter that provides methods to get data from the document such as the binary content for a File or the children items of a Folder.

It is used by Nuxeo Drive to fetch the needed data for synchronization.

Factories can be contributed to implement a specific behavior for the FileSystemItem retrieval depending on the document type or facet.

Resolution Order

188
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

786
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.drive.service.impl.FileSystemItemAdapterServiceImpl

Services

Extension Points

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.drive.service.FileSystemItemAdapterService"
  version="1.0">

  <documentation>
    @author Antoine Taillefer (ataillefer@nuxeo.com)

    This service allows to get a FileSystemItem from a
    DocumentModel.

    FileSystemItem is an adapter that provides methods to
    get data from the document such as the binary content for a File
    or the children items of a Folder.

    It is used by Nuxeo Drive to fetch the needed data for synchronization.

    Factories can be contributed to implement a specific behavior
    for the FileSystemItem retrieval
    depending on the document type or facet.
  </documentation>

  <service>
    <provide interface="org.nuxeo.drive.service.FileSystemItemAdapterService" />
  </service>

  <implementation
    class="org.nuxeo.drive.service.impl.FileSystemItemAdapterServiceImpl" />

  <extension-point name="fileSystemItemFactory">

    <documentation>
      @author Antoine Taillefer (ataillefer@nuxeo.com)

      This extension point lets you contribute custom
      FileSystemItem factories according to a document
      type or facet.

      Example of the DefaultFileSystemItemFactory:
      <code>
        <extension
          target="org.nuxeo.drive.service.FileSystemItemAdapterService"
          point="fileSystemItemFactory">
          <fileSystemItemFactory name="defaultFileSystemItemFactory" order="50"
            class="org.nuxeo.drive.service.impl.DefaultFileSystemItemFactory">
            <parameters>
              <parameter name="versioningDelay">3600</parameter>
              <parameter name="versioningOption">MINOR</parameter>
            </parameters>
          </fileSystemItemFactory>
         </extension>
      </code>
      Please note that `versioningDelay` and `versioningOption` parameter have been deprecated since 9.1 and are not
      used anymore as automatic versioning is now handled at versioning service level.

      Example of a FileSystemItem factory for documents with the Picture facet:
      <code>
        <extension
          target="org.nuxeo.drive.service.FileSystemItemAdapterService"
          point="fileSystemItemFactory">
          <fileSystemItemFactory name="picture" facet="Picture" order="100"
            class="org.nuxeo.drive.sample.PictureFileSystemItemFactory" />
         </extension>
      </code>

    </documentation>

    <object class="org.nuxeo.drive.service.impl.FileSystemItemFactoryDescriptor" />

  </extension-point>

  <extension-point name="topLevelFolderItemFactory">

    <documentation>
      @author Antoine Taillefer (ataillefer@nuxeo.com)

      This extension point lets you contribute the factory
      for the top level FolderItem.

      Example of the DefaultTopLevelFolderItemFactory:
      <code>
        <extension
          target="org.nuxeo.drive.service.FileSystemItemAdapterService"
          point="topLevelFolderItemFactory">
          <topLevelFolderItemFactory class="org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory" />
         </extension>
      </code>

    </documentation>

    <object class="org.nuxeo.drive.service.impl.TopLevelFolderItemFactoryDescriptor" />

  </extension-point>

  <extension-point name="activeFileSystemItemFactories">

    <documentation>
      @author Antoine Taillefer (ataillefer@nuxeo.com)

      This extension point lets you contribute the active FileSystemItem factories.

      Example of the default contribution:
      <code>
        <extension target="org.nuxeo.drive.service.FileSystemItemAdapterService"
          point="activeFileSystemItemFactories">
          <activeTopLevelFolderItemFactory>org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory
          </activeTopLevelFolderItemFactory>
          <activeFileSystemItemFactories>
            <factories>
              <factory>defaultSyncRootFolderItemFactory</factory>
              <factory>defaultFileSystemItemFactory</factory>
            </factories>
          </activeFileSystemItemFactories>
        </extension>
      </code>

      Example of a custom contribution:
      <code>
        <extension target="org.nuxeo.drive.service.FileSystemItemAdapterService"
          point="activeFileSystemItemFactories">
          <activeTopLevelFolderItemFactory>org.nuxeo.drive.hierarchy.userworkspace.factory.UserWorkspaceTopLevelFactory
          </activeTopLevelFolderItemFactory>
          <activeFileSystemItemFactories merge="true">
            <factories>
              <factory enabled="false">defaultSyncRootFolderItemFactory</factory>
              <factory>userWorkspaceSyncRootParentFactory</factory>
              <factory>userWorkspaceSyncRootFactory</factory>
            </factories>
          </activeFileSystemItemFactories>
        </extension>
      </code>

    </documentation>

    <object class="org.nuxeo.drive.service.impl.ActiveFileSystemItemFactoriesDescriptor" />
    <object class="org.nuxeo.drive.service.impl.ActiveTopLevelFolderItemFactoryDescriptor" />

  </extension-point>

</component>